<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>人员管理</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<script src="./js/date.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE7 {font-size: 12px; font-weight: bold; }
.STYLE8 {
	font-size: 16px;
	font-weight: bold;
}
-->
 </style>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
	function check(){		
		if(document.all.username.value == "")
		{
			alert('用户名不能为空');
			document.all.username.focus();
			return false;
		}
		if(document.all.password1.value=="")
		{
			alert('密码不能为空');
			document.all.password1.focus();
			return false;
		}
		if(document.all.password2.value!=document.all.password1.value)
		{
			alert('密码与确认密码不一样，请重新输入');
			document.all.password1.focus();
			return false;
		}
		if(document.all.realname.value=="")
		{
			alert('真实姓名不能为空');
			document.all.realname.focus();
			return false;
		}
		if(document.all.birthday.value=="")
		{
			alert('出生日期不能为空');
			document.all.birthday.focus();
			return false;
		}
		if(document.all.cardcode.value=="")
		{
			alert('身份证号码不能为空');
			document.all.cardcode.focus();
			return false;
		}
		if(document.all.mobile.value=="")
		{
			alert('移动电话不能为空');
			document.all.mobile.focus();
			return false;
		}
		if(document.all.phone.value=="")
		{
			alert('固定电话不能为空');
			document.all.phone.focus();
			return false;
		}
		if(document.all.email.value=="")
		{
			alert('电子邮件不能为空');
			document.all.email.focus();
			return false;
		}
		if(document.all.address.value=="")
		{
			alert('地址不能为空');
			document.all.address.focus();
			return false;
		}
		if(document.all.postalcode.value=="")
		{
			alert('邮编不能为空');
			document.all.postalcode.focus();
			return false;
		}
		form1.submit();
	}
	function update(){		
		form1.action="employeeModify.action";
		check();
	}
	function add(){
		form1.action="employeeAdd.action";
		check();
	}
</script>		
</head>
<body style="overflow-x:hidden">
<ww:property value="msg"/>
<FORM name="form1" method="post">
<table width="850" height="568" border="0" align="center" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="523">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top">
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="30" colspan="3" valign="middle"><span class="STYLE1">&nbsp;[人员管理]--&gt;[<ww:if test="flag=='update'">用户修改</ww:if><ww:else>用户添加</ww:else>]</span></td>
				<td width="30">&nbsp;</td>
			</tr>
			
			<tr>
				<td height="59" colspan="3" align="center" valign="middle">
					<span class="STYLE8"><ww:if test="flag=='update'">用户修改</ww:if><ww:else>用户添加</ww:else></span></td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="89" height="356">&nbsp;</td>
				<td width="662" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing=1
					bgcolor=5cb7fe>
				  <!--DWLayoutTable--><input name="userid" type="hidden" value="<ww:property value="userdetail.userinfo.userid"/>">
				  <input name="userdetailid" type="hidden"  value="<ww:property value="userdetail.id"/>">
				  <tr>
				    <td width="299" height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">用&nbsp; 户&nbsp; 名：</span></td>
			      <td width="360" valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="username" type="text" id="username"  maxlength="30" value="<ww:property value="userdetail.userinfo.username"/>" <ww:if test="flag=='update'">readonly="true" </ww:if> style="height:18px;"></td>
				  </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF" class="STYLE1">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 码：</td>
				    <td valign="middle" bgcolor="#D8EDFF">&nbsp;				      <input name="password1" type="password" value="<ww:property value="userdetail.userinfo.password"/>"  maxlength="30" style="height:18px; width:156px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">确认密码：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="password2" type="password" maxlength="30" value="<ww:property value="userdetail.userinfo.password"/>" style="height:18px; width:156px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">真实姓名：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="realname" type="text" id="realname"  maxlength="6" value="<ww:property value="userdetail.realname"/>"  style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 别：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF">&nbsp;			        <select name="sex">					
				      <option value="男" <ww:if test="userdetail.sex='男'">selected</ww:if>>男</option>
				      <option value="女" <ww:if test="userdetail.sex='女'">selected</ww:if>>女</option>
			        </select></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">出生日期：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			          <input name="birthday" id="date" type="text" readonly="true" value="<ww:property value="userdetail.birthday"/>" onDblClick="setday(this,birthday)" dataType="Date" format="ymd" msg="请选择实际结束时间！" >
		            <input name="Submit" type="button" onClick="setday(this,birthday)" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'" onMouseOut="this.className='btn1_mouseout'" value="选择日期"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">身份证号码：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="cardcode" type="text" id="cardcode" maxlength="18" value="<ww:property value="userdetail.cardcode"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">移动电话：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="mobile" type="text" id="mobile" maxlength="13" value="<ww:property value="userdetail.mobile"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">固定电话：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="phone" type="text" id="phone" maxlength="13" value="<ww:property value="userdetail.phone"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">电子邮件：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="email" type="text" id="email" maxlength="20" value="<ww:property value="userdetail.email"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">传&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 真：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="fax" type="text" id="fax" value="<ww:property value="userdetail.fax"/>" style="height:18px;">
                    <span class="STYLE1">&nbsp; (可不填)</span></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">地&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 址：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="address" type="text" id="address" maxlength="50" value="<ww:property value="userdetail.address"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">邮政编码：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="postalcode" type="text" id="postalcode"  maxlength="6" value="<ww:property value="userdetail.postalcode"/>" style="height:18px;"></td>
			      </tr>
				  <tr>
				    <td height="26" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">QQ：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="qq" type="text" id="qq" maxlength="12" value="<ww:property value="userdetail.qq"/>" style="height:18px;">
			        <span class="STYLE1">&nbsp; (可不填)</span></td>
			      </tr>
				  <tr>
				    <td height="28" align="right" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1">MSN：</span></td>
				    <td valign="middle" bgcolor="#D8EDFF"> &nbsp;
			        <input name="msn" type="text" id="msn" maxlength="30" value="<ww:property value="userdetail.msn"/>" style="height:18px;">
			        &nbsp;
                    <span class="STYLE1">(可不填)</span></td>
			      </tr>
			    </table></td>
				<td width="42">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td height="43">&nbsp;</td>
				<ww:if test="flag!='update'">
				<td align="center" valign="bottom"><input type="button" name="Submit2" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'"
onMouseOut="this.className='btn1_mouseout'" value=" 添 加 " onclick="add()">
				</ww:if><ww:else>
				<td align="center" valign="bottom"><input type="button" name="Submit3" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'"
onMouseOut="this.className='btn1_mouseout'" value=" 更 新 " onclick="update()">
				</ww:else>
			    &nbsp;&nbsp;&nbsp; <input type="button" name="Submit32" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'"
onMouseOut="this.className='btn1_mouseout'" value=" 返 回 " onclick="window.location='employeeShow.action?flag=show'"></td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			<tr><td height="19"></form>
		    <td>&nbsp;</td>
		    <td>&nbsp;</td>
		    <td>&nbsp;</td>



			<tr>
				<td height="72" colspan="4" valign="top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<!--DWLayoutTable-->
					<tr>
						<td width="834" height="72">&nbsp;</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100%" /></td>
	</tr>



	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
</FORM>
</body>
</html>
